<?php ?>
<script type="text/javascript">
$(document).ready(function() {
var inner = $('#inner_<?php echo $contentid ?>_<?php echo $id ?>');
var outer = $('#outer_<?php echo $contentid ?>_<?php echo $id ?>');
var controls = $('#controls_<?php echo $contentid ?>_<?php echo $id ?>');
inner.mouseover(
			function(){
				if( outer.css('display') == 'none' ){
					var off = inner.offset();
					outer.css( 'left',off.left );
					outer.css( 'top',off.top );
					outer.css('height',inner.outerHeight()-2);
					outer.css('width',inner.outerWidth());
					outer.css('display','block');
					var adjust = off.left + parseInt(inner.css('width' ) )- 70;
					controls.css( 'left',adjust );
					controls.css( 'top',off.top+10 );
					controls.css('display','block');
				}
			}
		); 
outer.mouseout(
		function(){
			if( outer.css('display') == 'block' ){
				outer.css('display','none' );
				controls.css('display','none');
			}
		}
	); 

});
</script>
<div id="controls_<?php echo $contentid ?>_<?php echo $id ?>" class="controls_section_editable" > 
<?php 
	if(!empty($publish_btn)){
		echo $publish_btn;
	}
	if(!empty($edit_btn)){
		echo $edit_btn;
	}
	if(!empty($del_btn)){
		echo $del_btn;
	}
	if( !empty( $publish_url ) ){
		$hidden = array('refurl' => current_url(),'section_type' => $section_type,'content_id' => $contentid,'content_editor_type' => $content_editor_class );
		$atts = array('id' => "publish_".$contentid."_$id" );
		echo form_open($publish_url,$atts,$hidden);
		echo "</form>";
	}
	if( !empty( $edit_url ) ){
		$hidden = array('refurl' => current_url(),'section_type' => $section_type,'content_id' => $contentid );
		$atts = array('id' => "edit_".$contentid."_$id");
		echo form_open($edit_url,$atts,$hidden);
		echo "</form>";
	}
	if( !empty( $del_url ) ){
		$hidden = array('refurl' => current_url(),'section_type' => $section_type,'content_id' => $contentid );
		$atts = array('id' => "delete_".$contentid."_$id");
		echo form_open($del_url,$atts,$hidden); 
		echo "</form>";
	}
?>
</div>
<div id="outer_<?php echo $contentid ?>_<?php echo $id ?>" class="content_section_editable_hover" >
</div>
<div id="inner_<?php echo $contentid ?>_<?php echo $id ?>" class="content_section_editable <?php if( !empty($published) ){echo $published;} ?>" >
<?php 
	if(!empty($content_section)){
		echo $content_section;
	}
?>

</div>
